package com.creditease.shield.config;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Sender {

	@Autowired
	private AmqpTemplate rabbitTemplate;

	public void send() throws Exception{
		for(int i=1;i<=10000;i++){
			String context = "hello:"+i+new Date();
			System.out.println("Sender:" + context);

			this.rabbitTemplate.convertAndSend("hello","hello", context);
		}
		
	}
}
